function  share(){
	if (typeof WeixinJSBridge == "undefined"){
	            if( document.addEventListener ){
	                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
	            }else if (document.attachEvent){
	                document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
	                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
	            }
	        }else{
	            onBridgeReady();
	        }
}
function onBridgeReady() {
//			var imgUrl = document.images.mobileImgLogo.src;
			var imgUrl = document.getElementById("newLogoImg").value;
        	var link   = document.getElementById("shareLink").value;
			var title  = document.getElementById("shareTitle").value;
			var desc   = document.getElementById("shareDesc").value;

            // 发送给好友; 
            WeixinJSBridge.on('menu:share:appmessage', function(argv){
				WeixinJSBridge.invoke('sendAppMessage',{
									  "img_url"    : imgUrl,
									  "img_width"  : "640",
									  "img_height" : "640",
									  "link"       : link,
									  "desc"       : desc,
									  "title"      : title
				}, function(res) {}
				);
            });

             // 分享到朋友圈;
            WeixinJSBridge.on('menu:share:timeline', function(argv){
				WeixinJSBridge.invoke('shareTimeline',{
									  "img_url"    : imgUrl,
									  "img_width"  : "640",
									  "img_height" : "640",
									  "link"       : link,
									  "desc"       : desc,
									  "title"      : title
				}, function(res) {}
				);
	
            });
       
        }

        
function showLoginBlock(){
	var type = document.getElementById("indexLoginBlockValue").value;
	if(type == 0){
		document.getElementById("indexLoginPop").style.display = "";
		document.getElementById("indexLoginBlockValue").value = 1;
	}else{
		document.getElementById("indexLoginPop").style.display = "none";
		document.getElementById("indexLoginBlockValue").value = 0;
	}
}

function applyForActive(){
	var url = "/mobile/submitParticipate.do?random="+Math.round(Math.random()*100);
	var phone = trim(document.getElementById("applyPhone").value);
	var name = trim(document.getElementById("applyName").value);
	var areaCode = document.getElementById("applyAreaCode").value;
	document.getElementById("applyErrorTips").innerHTML = "";
	if(name == ""){
		document.getElementById("applyErrorTips").innerHTML = "请输入您的姓名";
		return;
	}
	if(phone == ""){
		document.getElementById("applyErrorTips").innerHTML = "请输入您的手机号";
		return;
	}
	var param={phone:phone,name:name,areaCode:areaCode};
	jQuery.post(url,param,function(data){
		if(data > 0){
			document.getElementById("applyPhone").value = "";
			document.getElementById("applyName").value = "";
			alert("恭喜您报名成功");
		}else if(data == -1){
			document.getElementById("applyErrorTips").innerHTML = "手机号输入不合法";
		}else if(data == -2){
			document.getElementById("applyErrorTips").innerHTML = "手机号已存在";
		}else if(data == -3){
			document.getElementById("applyErrorTips").innerHTML = "您的姓名输入不合法";
		}
	});
}